package com.hxgis.statisticanalysis.utils;

/**
 * 公共常数值
 *
 * @author machao
 * @date 2020/7/13
 */
public class CommonValue {

    //时间对应的毫秒数
    public static final long minute = 60000;
    public static final long ten_minute = 10 * minute;
    public static final long two_minute = 2 * minute;
    public static final long six_minute = 6 * minute;
    public static final long hour = 60 * minute;
    public static final long day = 24 * hour;


    public static long getRoundMinute(long mills) {
        return mills / minute * minute;
    }

    public static long getRound10Minute(long mills) {
        return getRoundXMinute(mills, 10);
    }

    public static long getRoundXMinute(long mills, int x) {
        long l = x * minute;
        return mills / l * l;
    }

    public static long getRoundHour(long mills) {
        return mills / hour * hour;
    }
}
